#include "gcc_interface.h"
#include <iostream>

void callback(void* gcc_data, void* user_data)
{
    // If there were errors during compilation let GCC handle the exit.
    if (errorcount || sorrycount)
        return;

    int r = 0;
    std::cerr << "processing " << main_input_filename << std::endl;
    interface::traverse(global_namespace);
    exit(r);
}

init_plugin(PLUGIN_OVERRIDE_GATE, callback)
